define(['app','js/directive/listTree','js/filter/tree2Arr','datetime','pagination','filesaver','fileupload','floatlayer'], function( app ) {
  'use strict';
  /*财务操作管理*/
  app.controller('Caiwu.money', function ($scope, dataFactoryCRM , $q,$compile,Upload,$http) {
    $scope.Cid;
    $scope.Vid;
    $scope.info;
    $scope.applyperson = "";
    $scope.payperson = "";
    $scope.paytime = "";
    $scope.statisticspage = {pageAll:1,pageNow:1,pageSize:20,k:3};
    $scope.moneypage = {pageAll:1,pageNow:1,pageSize:$scope.psize,k:321};
    $scope.search_param = {sales:'',pay_name:'',customer_name:'',stime:'',etime:'',pay_way:'',audit:-1,status:1};
    $scope.pageParam = {prices:[],products:[],xufei:[],customer:[]};
    $scope.statistics_sn;
    $scope.statistics_pm;
    $scope.statistics;
    //发票收款单位
    $scope.payeetypes =[{k: '1', v: '北京和众汇富咨询有限公司北京分公司'},
                        {k: '2', v: '北京和众汇富咨询有限公司山东分公司'},
                        {k: '3', v: '北京和众汇富咨询有限公司天津分公司'}];
    $scope.enterSearch = function( evt ){
        if (evt && evt.keyCode==13) {
             $scope.search();
        }
    };

    $scope.search = function(){
        $scope.moneypage.pageNow = 1;
        $scope.getDataList();
    };

    $scope.getDataList = function(){
        var sUrl = "Money/index";
        var _param = $scope.search_param;
        _param['psize'] = $scope.moneypage.pageSize;
        _param['p'] = $scope.moneypage.pageNow;
        sUrl += "?" +  $.param( $scope.search_param );
        dataFactoryCRM.getDataByAPI( sUrl ).then( function( _d ){
        if( _d.rcode == 1){
          $scope.moneypage.pageSize = _d.psize;
          $scope.moneypage.pageAll = _d.pall;
          $scope.moneypage.pageNow = _d.p;
          $scope.money = _d.data;
        }else{
          $scope.moneypage.pageAll = 0;
        }
        });
      }

    //获取付款方式
    dataFactoryCRM.getDataByAPI('Money/paytypes').then(function(_d) {
        $scope.pageParam.payways = _d.data;
      });
    //初始化页面显示数据（如果是新弹出独立窗口则从父窗口获取）
    window.loadClientCacheToScope($scope, function() {
        $scope.getDataList();
    });
    //特殊处理semantic dropdown的反向绑定缺陷
    $scope.$watch('search_param.pay_way', function(newValue, oldValue) {
        setTimeout(function() {
            angular.element("select[ng-model='search_param.pay_way']").dropdown('set selected', newValue);
        });
    }, true);
   $scope.$watch('search_param.status', function(newValue, oldValue) {
        setTimeout(function() {
            angular.element("select[ng-model='search_param.status']").dropdown('set selected', newValue);
        });
    }, true);
    $scope.cus;
    $scope.Waitvertify = function(){
      $scope.cus = 0;
      $scope.moneyDataList();
    }

    $scope.faultvertify = function(){
      $scope.cus = 2;
      $scope.moneyDataList();
    }

    $scope.successvertify = function(){
      $scope.cus = 1;
      $scope.moneyDataList();
    }

    $scope.totally = function(){
      $scope.cus = -1;
      $scope.moneyDataList();
    }

    /*错误提示弹出框*/
    $scope.msgAttention = function() {
        $('.ui.systemerror').modal({
            closable: true,
            onDeny: function() {
                return true;
            },
            onApprove: function() {
                $('.ui.dimmer.modals.page.transition.visible.active.dimmers').removeClass('dimmers');
            }
        }).modal('show');

        setTimeout(function() {
            var system = $('.ui.dimmer.modals.page.transition.visible.active');
            if (system) {
                $('.ui.dimmer.modals.page.transition.visible.active').addClass('dimmers');
            }
        }, 1000);
    };

    $scope.export_r = function(){
      var createtime = $('#createtime').val();
      var endtime = $('#endtime').val();
      var checkperson =$('#creator').val();
      var rand = Math.floor(1000 +Math.random()*(9999-1000));
     var url ='Money/excel_runexport?createtime='+ createtime + '&endtime=' + endtime + '&checkperson=' + checkperson;
                dataFactoryCRM.getDataByAPIS(url)
                    .then(function(data){
                      var blob = new Blob([data], {
                          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                      });
                      saveAs(blob,''+ rand +'.xls');
                  });

    }

  // 导出查账
  $scope.export_s = function(){
          dataFactoryCRM.getDataByAPI('Money/getCreator')
            .then(function(data){
              $scope.user = data;
          });
          $('#export input').val('');
          $('#default_txt').text('查账申请人');
          $('.ui.pay.modal').modal({
              onApprove: function() {
              }}).modal('show');
    }

    // 验证查账
    $scope.verify = function(_d){
      $("#verifyID").form('reset');
      var _mon = this.mon;
      /** 20170712 Wjw 修改查账审核开始**/
      $("#payrecord_id").val(_mon.payrecord_id);
      $scope.mon = _mon;
      var arr = new Array();
      for(var i=0;i<$scope.money.length;i++){
        if($scope.money[i].contract_id == $scope.mon.contract_id && $scope.money[i].payrecord_id != $scope.mon.payrecord_id && $scope.money[i].pay_order == $scope.mon.pay_order){
          arr.push($scope.money[i]);
        }
      }
      if(arr.length > 0){
        $scope.related = arr; 
        $scope.related_messge = true;
      }else{
        $scope.related_messge = false;
      }
      /**修改查账审核结束**/
      $('.ui.verify.modal').modal({
        onApprove: function() {
        if( $('#verifyID').form('is valid') ){
            dataFactoryCRM.getDataByAPI('Money/auditVerify?payrecord_id='+ _mon.payrecord_id)
              .then(function(data){
                if(data.rcode == 1)
                  $(".ui.modal1").modal('show');
                else
                   $(".ui.modal2").modal('show');
                $scope.msg = data.msg;
                setTimeout(function() {
                        $('.time').modal('hide')
                    }, 3000)
                $scope.getDataList();
            });
            return true;
        }else{
          return false;
        }
      }}).modal('show');
    }

    // 拒绝查账
    $scope.refuse = function(){
        $('.ui.refuse_audit.modal').modal('show');
    }

    //拒绝二次确认
    $scope.refuse_audit = function(){
        dataFactoryCRM.getDataByAPI('Money/auditVerify?payrecord_id='+$scope.mon.payrecord_id + '&identify=' + 2).then(function(data){
          $scope.getDataList();
       });
    }

  $scope.record_a = '';
  //退款审核界面
  $scope.verify_reback = function(){
    var _mon = this.mon;
    $('#payrecord_id_rbk').val(_mon.payrecord_id);
    if(_mon.audit_msg){
      $scope.V_auditmsgReturn = _mon.audit_msg;
      $scope.Audit_return = 1;
    }else{
      $scope.Audit_return = 0;
    }
      dataFactoryCRM.getDataByAPI('Money/getrecord?customer_id='+_mon.customer_id +'&contract='+_mon.contract_id).then(function(d){
        var Da = $('#record_rb').val();
        $('#info_rbk').val('');
        if (d['rcode'] && !Da) {
          for (var i = 0; i < d.data.length; i++) {
             $scope.record_a += d.data[i].pay_time + d.data[i].pay_mount + d.data[i].nickname + d.data[i].pay_way + '\n' + '\n';
          }
          $scope.note_rbk = _mon.note;
          $scope.pay_mount_rbk = _mon.pay_mount;
        }

      });
       $('.ui.aa').modal({
          onApprove: function() {
              $scope.$emit("BUSY");
               var url = 'Money/Verfed?payrecord_id=' + _mon.payrecord_id + '&info=' + $scope.info_rbk  + '&identify=' + 1 + '&paytype='+ $('#paytype_rbk').val();
               if( $('#verify_re_back').form('is valid') ){
                 dataFactoryCRM.getDataByAPI(url).then(function(d){
                    // console.log(d);
                     if (d['rcode']=="1") {
                        if( $scope.money ){
                          $scope.moneyDataList();
                        }
                    }else{
                        $scope.$emit("NOTBUSY");
                        $scope.productMsg = d.msg;
                        $scope.msgAttention();
                    }
                    $scope.$emit("NOTBUSY");
                 });
                 return true;
              }else{
                     return false;
              }
          }
        }).modal('show');
  }

  //退款拒绝
  $scope.verify_reback_refuse = function(){
        $scope.$emit("BUSY");
         var url = 'Money/Verfed?payrecord_id=' + $('#payrecord_id_rbk').val() + '&info=' + $scope.info_rbk  + '&identify=' + 2 + '&paytype='+ $('#paytype_rbk').val();
         if( $('#verify_re_back').form('is valid') ){
           dataFactoryCRM.getDataByAPI(url).then(function(d){
            // console.log(d);
               if (d.rcode == 1) {
                  if( $scope.money ){
                    $scope.moneyDataList();
                  }
              }else{
                  $scope.mongeyrcode = 0;
                  $scope.$emit("NOTBUSY");
                  $scope.moneyMsg = d.msg;
                  $scope.msgAttention();
              }
           });
           return true;
        }else{
           $scope.$emit("NOTBUSY");
           return false;
        }
    }

    // 业绩统计搜索
    $scope.search_static = function(){
      $scope.$emit("BUSY");
      var _url = 'Money/statistics?start='+ $('#s_static').val() +'&end=' + $('#e_static').val() +'&S_ver='+$('#T_static').val()+"&psize="+ $scope.statisticspage.pageSize +"&p="+$scope.statisticspage.pageNow;
      dataFactoryCRM.getDataByAPI(_url).then(function(_d) {
          if (_d.rcode) {
            if (_d.verify == 1) {
              $scope.statisticspage.pageSize = _d.psize;
              $scope.statisticspage.pageAll = _d.pall;
              $scope.statisticspage.pageNow = _d.p;
              $scope.statistics = _d.data;
            }else if(_d.verify == 2){
              $scope.statisticspage.pageSize = _d.psize;
              $scope.statisticspage.pageAll = _d.pall;
              $scope.statisticspage.pageNow = _d.p;
              $scope.statistics = _d.data;
            }
          } else {
            $scope.statisticspage.pageAll = 0;
            $scope.$emit("NOTBUSY");
            $scope.moneyMsg = _d.msg;
            $scope.msgAttention();
        }
        $scope.$emit("NOTBUSY");
        });
    }

    // 业绩统计list
    $scope.second = function(){
      $scope.search_static();
    }
    $scope.$watch('search_param.audit', function(nV, oV){
        if( oV == nV ) return;
        $scope.search();
    });
    /*******************************添加发票功能begin****************************************************/
    /*系统错误调用*/
    $scope.msgAttentions = function() {
        $('.ui.second').modal({
            allowMultiple: true,
            closable: false,
            onDeny: function() {
                window.alert('Wait not yet!');
                return false;
            },
        }).modal('show');
    };
    /*获取添加发票金额，计算税额*/
    $scope.setTax = function(){
      var money = parseFloat($scope.invoice_money);
      $scope.invoice_tax = Math.round(parseFloat((money-money/1.06)));
    }

    /*获取添加专票发票金额，计算税额*/
    $scope.imgPost_tax = function(){
      var imgPost_money = parseFloat($scope.imgPost_money);
      $scope.imgPost_taxs = Math.round(parseFloat((imgPost_money-imgPost_money/1.06)));
    }

    /*选择发票类型*/
    $scope.switchType = function(key) {
      $scope.invoicetype = key;
      $scope.getCusPayInfo();
      $('#selectType').removeClass('ui basic red pointing prompt label transition visible');
      document.getElementById("selectType").innerHTML ='';
      setTimeout(function(){
          $('.ui.addInvoice.modal').modal('refresh');
        },100);
    };

    /*选择邮寄情况*/
    $scope.deliveType = function(key){
        $('#add_sty').removeClass('ui basic red pointing prompt label transition visible');
          document.getElementById("add_sty").innerHTML ='';
          setTimeout(function(){
            $('.ui.addInvoice.modal').modal('refresh');
          },100);
        $scope.delivetype = key;
        var pay_id = $("input:checkbox[name='chbidsAdd']:checked").map(function(index,elem) {
          return $(elem).val();
        }).get().join(',');
        if (pay_id.length < 1) { //没有选择删除项
          return;
        }
        $("#delivery-add").form('reset');
        dataFactoryCRM.getDataByAPI('invoice/getPayInfos?pay_id='+pay_id).then(function(d) {
            if (d.rcode) {
                if(d.deliveInfo.length>0 && d.customerInfo){
                  $('#delivery-add input[name="recipients"]').val(d.deliveInfo[0]['nickname']);
                  $('#delivery-add input[name="phone"]').val(d.deliveInfo[0]['phone']);
                  $('#delivery-add input[name="address"]').val(d.deliveInfo[0]['address']);
                }else if(d.deliveInfo.length==0 && d.customerInfo){
                    $('#delivery-add input[name="recipients"]').val(d.customerInfo['nickname']);
                    $('#delivery-add input[name="phone"]').val(d.customerInfo['phone']);
                    $('#delivery-add input[name="address"]').val(d.customerInfo['address']);
                }
            }
        });
        $('#delivery-add input[name="send_time"]').val($scope.getToday());
    }

    /*获取客户付款、发票信息*/
    $scope.getCusInfo = function( customer_id ){
      dataFactoryCRM.postDataByAPI('invoice/getCustomerInfo','customer_id='+customer_id+'&pay_name='+$scope.invoice_pay_name)
          .then(function(d) {
            $scope.customerVerify = d.customerVerify; //付款或发票信息是否存在
              if(d.rcode){
                  $scope.payrecord_rcode = d.payrecord_rcode;
                  $scope.invoice_rcode = d.invoice_rcode;
                  $scope.payrecordInfo = d.payrecordInfo; //付款信息
                  $scope.total_paymount = d.total_paymount;  //总付款金额
                  $scope.invoiceInfo = d.invoiceInfo; //发票信息
                  $scope.total_money = d.total_money; //发票总金额
              }else{
                  $scope.customerid = '';
              }
          });
    }

    /*添加-根据payrecord_id获取付款信息*/
    $scope.getCusPayInfo = function(pay_id){
      var pay_id = $("input:checkbox[name='chbidsAdd']:checked").map(function(index,elem) {
          return $(elem).val();
        }).get().join(',');
        if (pay_id.length > 1) {
          $('#selectPaysAdd').removeClass('ui basic red pointing prompt label transition visible');
          document.getElementById("selectPaysAdd").innerHTML ='';
        }
        if (pay_id.length < 1) { //没有选择删除项
          return;
        }
      dataFactoryCRM.getDataByAPI('invoice/getPayInfos?pay_id='+pay_id).then(function(d) {
        if (d.rcode) {
          if($scope.invoicetype == 1){ //普通发票
              $scope.invoice_title = $scope.invoice_pay_name;
              $scope.invoice_money = d.payMountSum['paymount'];
              $scope.invoice_tax = Math.round(parseFloat(($scope.invoice_money-$scope.invoice_money/1.06)));
          }else if($scope.invoicetype == 2){  //专票
              $scope.imgPost_title = $scope.invoice_pay_name;
              $scope.imgPost_money = d.payMountSum['paymount'];
              $scope.imgPost_taxs = Math.round(parseFloat(($scope.imgPost_money-$scope.imgPost_money/1.06)));
          }
          if(d.deliveInfo.length>0 && d.customerInfo){
            $('#delivery-add input[name="recipients"]').val(d.deliveInfo[0]['nickname']);
            $('#delivery-add input[name="phone"]').val(d.deliveInfo[0]['phone']);
            $('#delivery-add input[name="address"]').val(d.deliveInfo[0]['address']);
          }else if(d.deliveInfo.length==0 && d.customerInfo){
            $('#delivery-add input[name="recipients"]').val(d.customerInfo['nickname']);
            $('#delivery-add input[name="phone"]').val(d.customerInfo['phone']);
            $('#delivery-add input[name="address"]').val(d.customerInfo['address']);
          }
        }
      });
    }
    /*根据客户id获取客户名*/
    $scope.getCustomerName = function(customer_id){
      dataFactoryCRM.postDataByAPI('Money/getCusName','customer_id='+customer_id)
          .then(function(d) {
              $scope.mongeyrcode = d.rcode;
              $scope.moneyMsg = d.msg;
              if(d.rcode){
                  $scope.invoice_customer_name = d.data['nickname'];
              }else{
                  $scope.msgAttention();
                  $scope.invoice_customer_name = "";
              }

          });
    }

    /*获取当前日期*/
    $scope.getToday = function(){
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth()+1;
      var day = date.getDate();
      if(month<9){
        month = '0'+month;
      }
      var today = year+'-'+month+'-'+day;
      return today;
    }
    $scope.getToday();
    /*添加发票*/
    $scope.addinvoice = function(){
      var _mon = this.mon;
      $scope.invoice_pay_name = _mon.pay_name;
      $scope.invoice_payrecord_id = _mon.payrecord_id;
      $scope.getCusInfo(_mon.customer_id,_mon.pay_name);
      $('#frm-add input').val('');
      $("#frm-add").form('reset');
      $('#frm-imgPost input').val('');
      $('#add_sty').removeClass('ui basic red pointing prompt label transition visible');
      document.getElementById("add_sty").innerHTML ='';
      $('#selectType').removeClass('ui basic red pointing prompt label transition visible');
      document.getElementById("selectType").innerHTML ='';
      $scope.imgAdd = new Array();
      $scope.tax = "";
      $scope.imgPost_taxs = "";
      $scope.customerVerify = 0;
      $scope.invoicetype = 0;
      $scope.delivetype = 0;
      $('#payeeID>.ui.dropdown>.text').text('请选择收款单位');
      //去掉发票默认选择
      $("input:radio[name='frequency1']").attr("checked",false);
      $("input:radio[name='frequency1']").removeAttr('checked');
      $("input:radio[name='frequency2']").attr("checked",false);
      $("input:radio[name='frequency2']").removeAttr('checked');
      $('.ui.addInvoice').modal({
        observeChanges: true,onApprove: function() {
          var pay_id = $("input:checkbox[name='chbidsAdd']:checked").map(function(index,elem) {
              return $(elem).val();
            }).get().join(',');
          if(pay_id){  //选择开票流水
            if($scope.invoicetype==1){   //普通发票
                if($scope.delivetype == 1){  //发票邮寄
                    if($('#frm-add').form('is valid') && $('#delivery-add').form('is valid')){
                        $scope.addInvoice($('#frm-add').serialize()+'&delivetype='+$scope.delivetype+'&pay_id='+pay_id+'&'+$('#delivery-add').serialize()+'&status=0'+'&customer_id='+_mon.customer_id+'&tax='+$scope.invoice_tax );
                    }else return false;
                }else if($scope.delivetype == 2){   //发票自取
                    if($('#frm-add').form('is valid')){
                        $scope.addInvoice($('#frm-add').serialize()+'&delivetype='+$scope.delivetype+'&pay_id='+pay_id+'&status=2'+'&customer_id='+_mon.customer_id+'&tax='+$scope.invoice_tax );
                    }else return false;
                }else{      //未选择邮寄方式
                    $('#add_sty').addClass('ui basic red pointing prompt label transition visible');
                    document.getElementById("add_sty").innerHTML ='请选择邮寄情况！';
                    return false;
                }
            }else if($scope.invoicetype==2){      //专票
                if($scope.delivetype == 1){     //发票邮寄
                    if($('#frm-imgPost').form('is valid') && $('#delivery-add').form('is valid')){
                        $scope.imagesPost($('#frm-imgPost').serialize()+'&delivetype='+$scope.delivetype+'&pay_id='+pay_id+'&'+$('#delivery-add').serialize()+'&status=0'+'&customer_id='+_mon.customer_id);
                    }else return false;
                }else if($scope.delivetype == 2 ){
                    if($('#frm-imgPost').form('is valid')){   //发票自取
                        $scope.imagesPost($('#frm-imgPost').serialize()+'&delivetype='+$scope.delivetype+'&pay_id='+pay_id+'&status=2'+'&customer_id='+_mon.customer_id);
                    }else return false;
                }else{      //未选择邮寄方式
                    $('#add_sty').addClass('ui basic red pointing prompt label transition visible');
                    document.getElementById("add_sty").innerHTML ='请选择邮寄情况！';
                    return false;
                }
            }else{    //未选择发票类型
                $('#selectType').addClass('ui basic red pointing prompt label transition visible');
                document.getElementById("selectType").innerHTML ='请选择发票类型！';
                return false;
            }
          }else{    //未选择发票对应流水
              $('#selectPaysAdd').addClass('ui basic red pointing prompt label transition visible');
              document.getElementById("selectPaysAdd").innerHTML ='请选择付款流水！';
              return false;
          }
        }
      }).modal('show');
    }

    /*添加普通发票功能*/
    $scope.addInvoice = function(_url){
        $scope.busy = dataFactoryCRM.postDataByAPI('invoice/add', _url).then(function(d) {
            if (d.rcode) {
                $(".ui.small.modal.addInvOk").modal('show');
                setTimeout(function() {
                    $('.ui.small.modal.addInvOk').modal('hide')
                }, 3000);
                $scope.invoicetype = 0;
                $scope.customerVerify = 0;
                $scope.delivetype = 0; //默认付款、发票信息、邮寄信息不显示
                $scope.getDataList();
            } else {
                $(".ui.modal.addInvFail").modal('show');
                setTimeout(function() {
                    $('.ui.modal.addInvFail').modal('hide')
                }, 3000);
                $scope.invoicetype = 0;
                $scope.customerVerify = 0;
                $scope.delivetype = 0; //默认付款、发票信息、邮寄信息不显示
                $scope.getDataList();
                return false;
            }
        });
    }

    /*添加专票信息功能*/
    $scope.imagesPost = function(_d){
      var fd = new FormData();
      for (var i = $scope.imgAdd.length - 1; i >= 0; i--) {
        fd.append('img'+i, $scope.imgAdd[i]);
      };
      $http({
        method:'POST',
        url: '/Admin/invoice/addImgs',
        data: fd,
        headers: {'Content-Type':undefined},
        transformRequest: angular.identity
      }) .success( function ( datas ){
          if (datas.rcode==0) {
              $(".ui.modal.postFail").modal('show');
              setTimeout(function() {
                  $('.ui.modal.postFail').modal('hide')
              }, 3000);
          }else{
              var item = {d:_d,array:datas.data}
              dataFactoryCRM.postDataByAPI( 'Invoice/addSpecial',item).then(function(d) {
                  if(d.rcode){
                      $(".ui.small.modal.addInvOk").modal('show');
                        setTimeout(function() {
                            $('.ui.small.modal.addInvOk').modal('hide')
                        }, 3000);
                      $scope.invoicetype = 0;
                      $scope.customerVerify = 0;
                      $scope.delivetype = 0; //默认付款、发票信息、邮寄信息不显示
                      $scope.getDataList();
                  }else{
                      $(".ui.modal.addInvFail").modal('show');
                      setTimeout(function() {
                          $('.ui.modal.addInvFail').modal('hide')
                      }, 3000);
                      $scope.invoicetype = 0;
                      $scope.customerVerify = 0;
                      $scope.delivetype = 0; //默认付款、发票信息、邮寄信息不显示
                      $scope.getDataList();
                      return false;
                  }
              });
          }
          $scope.addPic = new Array();
      })
    }

    /*删除图片列表中已添加图片--添加页面*/
    $scope.delImg = function(){
      var index = this.$index;
      $scope.imgAdd.splice(index,1);
    }

    /*判断图片格式是否正确*/
    $scope.IsPic = function(file){
        var mime =/\.[^\.]+/.exec(file['name']);
        var imgExt = ['.gif','.GIF','.jpg','.JPG','.jpeg','.JPEG','.bmp','BMP','.png','.PNG','.swf','.SWF'];
        if(imgExt.indexOf(mime[0])>-1)
          return true;
        else
          return false;
    }

    /*添加新的图片--添加页面*/
    $scope.addChange =function (addPic) {
      if(addPic) {
        if($scope.IsPic(addPic)){      //图片格式判断
          if($scope.imgAdd.length==6){      //图片数量判断
            $scope.mongeyrcode = 0;
            $scope.moneyMsg = '最多可上传6张图片，请重新添加！';
            $scope.msgAttentions();
        }else{
          addPic.path = window.URL.createObjectURL(addPic);
          if($scope.imgAdd==null){
            var add = new Array();
            add[0] = addPic;
            $scope.imgAdd = add;
          }else
            $scope.imgAdd.push(addPic);
          }
        }else{
          $scope.mongeyrcode = 0;
          $scope.moneyMsg = '图片格式错误，请重新添加！';
          $scope.msgAttentions();
        }
      }
    };
    /*******************************添加发票功能end****************************************************/

  });
});
